package com.xbs.controller.backstage;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xbs.controller.base.BaseServlet;
import com.xbs.entity.PagesEntity;
import com.xbs.entity.selfOrderAdminEntity;
import com.xbs.service.selfdriving.selfDrivingServiceAdmin;

/**
 * 自驾租车订单管理
 * @author Administrator
 *
 */
@WebServlet("/backstage/selfdrivingOrder")
public class SelfdrivingOrderServlet extends BaseServlet {
	//存储查询到的分页集合
	private PagesEntity<selfOrderAdminEntity> pagese;
	//服务层对象
	private selfDrivingServiceAdmin sa;
	public SelfdrivingOrderServlet() {
		pagese = new PagesEntity<selfOrderAdminEntity>();
		sa = new selfDrivingServiceAdmin();
	}
		
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//获取系统当前时间
		Date now = new Date();
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
		String fromdate = df.format(now);
		String todate = df.format(now);
		String tel="";
		
		int currpage=1;
		int pagesize=10;
		
		//默认显示当天的所有订单
		pagese = sa.selAllco(fromdate, todate,tel,currpage,pagesize);
		req.setAttribute("pages", pagese);
		forward("admin/basicSetting/llp_selfdrivingOrder");
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		forward("admin/basicSetting/llp_selfdrivingOrder");
	}
}
